<!--  -->
<template>
  <div class="page-title">
    <div class="the_second_floor">
      <template v-if="isBack">
        <el-icon size="18" style="cursor: pointer" @click="router.back()">
          <Back />
        </el-icon>
      </template>
      <template v-else>
        <vab-icon v-if="routeInfo.meta && routeInfo.meta.icon" :icon="routeInfo.meta.icon" :is-custom-svg="routeInfo.meta.isCustomSvg" />
      </template>
      <div class="vab-form-content-title title_style c-#252525! ml-10px">
        {{ routeInfo.meta.title }}
      </div>
    </div>
    <div v-if="endTime">最后保存时间：{{ endTime }}</div>
  </div>
  <!-- <div class="custom-line"></div> -->
  <el-divider style="margin: 10px 0 20px" />
</template>

<script lang="ts" setup>
import { Back } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
const props = withDefaults(
  defineProps<{
    routeInfo: any
    isBack?: boolean
    endTime?: string
  }>(),
  {
    routeInfo: () => {
      return {}
    },
    isBack: false,
    endTime: '',
  }
)

const router = useRouter()
</script>

<style lang="scss" scoped>
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  .the_second_floor {
    display: flex;
    align-items: center;
  }
  .title_style {
    margin-left: 10px;
    color: #252525 !important;
  }
}
</style>
